﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using Common;


public class WeaponBase : MonoBehaviour
{

    public AvatarHandle Handle;
    public WeaponType Type;
    private bool ready = false;
    public void SetOwner(AvatarHandle handle)
    {
        Handle = handle;
        ready = true;
    }
    void OnTriggerEnter(Collider other)
    {
        if (!Handle.InputHandle.ActionIdle && other.gameObject.layer == Define.PlayerLayer && string.Compare(other.gameObject.name, Handle.Root.name) != 0)
        {
            int id = AssetHelp.GetPlayerId(other.gameObject.name);
            AvatarHandle p = Handle.Module.FindPlayer(id);
            if (p != null)
            {
                //p.Action.OnBeat(OnBeatDefine.OnBaseBeat, true);
            }
        }
        //.Physics.Physics.Linecast(
        //if(other.gameObject.layer )  
    }
}

